package com.sisqorap.andlotto;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.view.View;

public class Ball extends View{
	private final float x;
    private final float y;
    private final int r;
    private final String text;
    private final Paint mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
    private final Paint tPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
    
    public Ball(Context context, float x, float y, int r, String text) {
        super(context);
        mPaint.setColor(0xFFFF0000);
        tPaint.setColor(0x0000FF00);
        this.x = x;
        this.y = y;
        this.r = r;
        this.text = text;
    }
    
    @Override
    protected void onDraw(Canvas canvas) {
        super.onDraw(canvas);
        canvas.drawCircle(x, y, r, mPaint);
        //http://www3.ntu.edu.sg/home/ehchua/programming/android/Android_2D.html
        //http://www.androidcompetencycenter.com/2009/08/creatingcustomviews/
        canvas.drawText(text, x+r, y+r, tPaint);
    }
}
